package com.gitee.zycra.union.api.common.bo;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import javax.validation.Valid;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * @param <T> 查询参数类型
 * @author zycra
 */
@Getter
@Setter
@ToString
@Accessors(chain = true)
public final class PageQuery<T> {

    /**
     * 页码
     */
    @Min(1)
    @NotNull(message = "页码不能为空")
    private Integer page;

    /**
     * 每页数据条数
     */
    @Min(1)
    @Max(100)
    @NotNull(message = "页大小不能为空")
    private Integer size;

    /**
     * 查询参数对象
     */
    @Valid
    private T param;
}
